#include "junix.h"
using namespace std;

struct A
{
	int v_;
	A(int n):v_(n){ }

	int operator()()
	{
		return v_++;
	}
};

int main(int argc, char **argv)
{
	vector<int> V(20);
	generate( V.begin(), V.end(), A(1));
	cout<< accumulate(V.begin(),V.end(),0)<<endl;	

	cout<<accumulate(V.begin(), V.end(), 1, multiplies<int>())<<endl;
}
